#include <iostream>
#include <set>
using namespace std;

size_t Count(multiset<int> &s,const int& key)
{
	auto it=s.find(key);
	size_t count = 0;
	while (*it == key)
	{
		++count;
		++it;
	}
	return count;
}
int main()
{
	multiset<int> s{ 1,5,6,9,7,8,6,3,5,0 };
	for (const auto& e : s)
		cout << e << " ";
	cout << endl;
	cout << Count(s, 6) << endl;
	return 0;
}